<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt"	uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>订单页</title>
<link href="${ctx.resource}/css/select2.css" rel="stylesheet" >
<link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet" >
<link rel="stylesheet"  href="${ctx.resource}/front_css/style.css" type="text/css" />
<link rel="stylesheet"  href="${ctx}/static/css/style.css" type="text/css" />
<style>
.lr{width:60px;float:left;height:30px; text-align:right;line-height:30px;}
</style>
<script src="${ctx}/static/js/vendor/jquery-1.4.2.js"></script>
<!--进度条 js-->
<script type="text/javascript"  language=javascript>
function alertt()
{

	<c:if test="${not empty message}">
		alert('${message}');
	</c:if>

}
	function checkform() {
  if(orderform.name.value == '') {
    alert('请输入姓名！');
   // orderform.name.focus();
    return false;
  }
   if(orderform.sex.value == '') {
    alert('请输入性别！');
    orderform.sex.focus();
    return false;
  }
  if(orderform.schoolname.value == '') {
    alert('请输入学校中文名称！');
    orderform.schoolname.focus();
    return false;
  }
  if(orderform.grade.value == '') {
    alert('请输入年级！');
    orderform.grade.focus();
    return false;
  }
  if(orderform.email.value == '') {
    alert('请输入正确的邮箱！');
    orderform.email.focus();
    return false;
  }
  if(orderform.cellPhone.value.length!=11) {
    alert('请输入正确的手机号！ ');
    orderform.cellPhone.focus();
    return false;
  }
  if(!((orderform.fatherName.value != '' && orderform.fatherEmail.value != ''&&orderform.fatherPhone.value != '') ||(orderform.motherName.value != ''&&orderform.motherEmail.value != ''&&orderform.motherPhone.value != ''))) {
     alert('请将填全父母联系方式至少填全一个！');
    orderform.fatherName.focus();
    return false;
  }
  if(orderform.RadioGroupKnow1.value == '') {
    alert('请选择父母是否知晓相关信息！');
    orderform.RadioGroupKnow1.focus();
    return false;
  }
  if(orderform.RadioGroupAgree1.value == '') {
    alert('请选择父母是否同意参加该项目！');
    orderform.RadioGroupAgree1.focus();
    return false;
  }
  
  
  if(orderform.firstName.value == '') {
    alert('请输入姓拼音！');
    orderform.firstName.focus();
    return false;
  }
  if(orderform.lastName.value == '') {
    alert('请输入名拼音！');
    orderform.lastName.focus();
    return false;
  }
  document.orderform.submit();
}
</script>

<script language=javascript>
function Isemail(yx){
 var reyx= /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
 return(reyx.test(yx));
}
</script>
<script language="javascript" type="text/javascript" src="${ctx}/static/js/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript" language="javascript">
var total = Number('${sp.price}')+1000;
jQuery(document).ready(function(){
    $("#totalprice").val(total) ;
});
function show(obj){
var val=obj.value;
if(val=='是'){
$("#totalprice").val(total) ;
}
if(val=='否'){
$("#totalprice").val(total-1000) ;
}
}
</script>

  <script type="text/javascript">  
   /*  function XXX() {  
        displayMessage();  
    }  
      <span style="font-family:SimSun;">
    function displayMessage() {  
        if (navigator.userAgent.indexOf("Firefox") == -1) {  
            var obj = document.getElementsByTagName('SELECT');  
            for ( var i = 0; i < obj.length; i++) {  
                if (obj[i].type.indexOf("select") != -1)  
                    obj[i].style.visibility = 'hidden';  
            }  
            mask.style.visibility = 'visible';  
            massage_box.style.visibility = 'visible';  
        }  
    }  
    function hiddenMessage() {  
        mask.style.visibility = 'hidden';  
        massage_box.style.visibility = 'hidden';  
    }  
    var Obj = ''  
    document.onmouseup = MUp  
    document.onmousemove = MMove  
    function MDown(Object) {  
        Obj = Object.id  
        document.all(Obj).setCapture()  
        pX = event.x - document.all(Obj).style.pixelLeft;  
        pY = event.y - document.all(Obj).style.pixelTop;  
    }  
      
    function MMove() {  
        if (Obj != '') {  
            document.all(Obj).style.left = event.x - pX;  
            document.all(Obj).style.top = event.y - pY;  
        }  
    }  
      
    function MUp() {  
        if (Obj != '') {  
            document.all(Obj).releaseCapture();  
            Obj = '';  
        }  
    } </span>   */
    </script> 
</head>

<body onload="alertt();" style=" background:#fafafa;">
<div class="os-2015">
<!--  <script type="text/javascript" src="${ctx}/static/js/header.js"></script>--> 

<!--center-->
<div class="pay">
<div class="w">
<div class="pay01">
<div class="order-logo"><img src="${ctx}/static/images/order-img01.jpg" /></div>
<!--进度条-->
<ul>
<li><img src="${ctx}/static/images/s-select01.jpg" /></li>
<li>填写个人信息</li>
<li><img src="${ctx}/static/images/s-select01.jpg" /></li>
<li><img src="${ctx}/static/images/s-select02.jpg" /></li>
<li><img src="${ctx}/static/images/s-select01.jpg" /></li>
<li>支付项目</li>
<li><img src="${ctx}/static/images/s-select01.jpg" /></li>
<li><img src="${ctx}/static/images/s-select03.jpg" /></li>
<li><img src="${ctx}/static/images/s-select01.jpg" /></li>
<li id="act">完成</li>
<li><img src="${ctx}/static/images/s-select04.jpg" /></li>
</ul>
<!--进度条-->
</div>
<div class="order-main">
<p>个人信息</p>
<p style="color:#707070">请正确填写下列信息，以便我们尽快给您办理相关手续。</p>
<form action="${ctx}/order/pay" name="orderform" method="POST"  >
<p><label class="lr"><span>*</span> 学生姓名</label>&nbsp;&nbsp;<input value="${stu.name}" name="name" type="text" class="luru" /></p>
<p><label class="lr"><span>*</span> 姓拼音</label> &nbsp;&nbsp;<input value="${stu.firstName}" placeholder="如'马小花'此处填MA" name="firstName" type="text" class="luru" id="pinyin" onkeyup="value=value.replace(/[^\w\.\/]/ig,'');this.value = this.value.toUpperCase();"/></p>
<p><label class="lr"><span>*</span> 名拼音</label> &nbsp;&nbsp;<input value="${stu.lastName}" placeholder="如'马小花'此处填XIAOHUA" name="lastName" type="text" class="luru" id="pinyin" onkeyup="value=value.replace(/[^\w\.\/]/ig,'');this.value = this.value.toUpperCase();"/></p>
<p><label class="lr"><span>*</span> 性别</label>&nbsp;&nbsp;<select name="sex" class="luru">
      
     <option value="男"  <c:if test="${info.sex eq '男'}">selected="selected"</c:if>  />男</option>
   	<option value="女" <c:if test="${info.sex eq '女'}" >selected="selected"</c:if>   >女</option>
  
   
   
     
</select></p>
<p><label class="lr"><span>*</span> 学校</label>&nbsp;&nbsp;<input class="form-control"  type="text" value="${stu.schoolname}" name="schoolname"></input></p>
<p><label class="lr"><span>*</span> 年级</label>&nbsp;&nbsp;<input value="${stu.grade}" name="grade" type="text" class="luru" /></p>
<p><label class="lr"><span>*</span> 邮箱</label>&nbsp;&nbsp;<input value="${stu.email}" name="email" type="text" class="luru" /></p>
<p><label class="lr"><span>*</span> 手机</label>&nbsp;&nbsp;<input value="${stu.cellPhone}" name="cellPhone" type="text" class="luru" onkeyup="value=value.replace(/[^\d\.\/]/ig,'');"/></p>
<p><label class="lr"><span>*</span> 身份证号</label>&nbsp;&nbsp;<input value="${stu.idCard}" name="idCard" type="text" class="luru" /></p>
<p><label class="lr" style="width:200px;"><span>*</span> 父母联系方式（至少一个要填全）</label> </p>
<p><label class="lr"><span>*</span> 父亲姓名</label>&nbsp;&nbsp;<input value="${stu.fatherName}" name="fatherName" type="text" class="luru" /> <label >邮箱</label> <input value="${stu.fatherEmail}" name="fatherEmail" type="text" class="luru" /> <label>手机</label> <input value="${stu.fatherPhone}" name="fatherPhone" type="text" class="luru" /></p>
<p><label class="lr"><span>*</span> 母亲姓名</label>&nbsp;&nbsp;<input value="${stu.motherName}" name="motherName" type="text" class="luru" /> <label>邮箱</label> <input value="${stu.motherEmail}" name="motherEmail" type="text" class="luru" /> <label>手机</label> <input value="${stu.motherPhone}" name="motherPhone" type="text" class="luru" /></p>
<p><label class="lr" style="width:150px; text-align:left"><span>*</span> 父母是否已知晓相关信息</label>
    <label>
      <input class="checkboxOne"  type="radio" name="RadioGroupKnow1" value="是" id="RadioGroupKnow1_0" />
      是</label>
    <label>
      <input type="radio" name="RadioGroupKnow1" value="否" id="RadioGroupKnow1_1" />
      否</label></p>
      <p><label class="lr" style="width:155px; text-align:left""><span>*</span> 父母是否已同一参加该项目</label>
    <label>
      <input type="radio" name="RadioGroupAgree1" value="是" id="RadioGroupAgree1_0" />
      是</label>
    <label>
      <input type="radio" name="RadioGroupAgree1" value="否" id="RadioGroupAgree1_1" />
      否</label></p>
      
       <p><label class="lr" style="width:275px; text-align:left""><span>*</span> 是否选择酒店住宿(1000元/人 含三晚住宿及早餐)</label>
    <label>
      <input type="radio" name="RadioGroupHotel1" value="是" id="RadioGroupHotel1_0" checked="checked" onclick="javascript:show(this)"/>
      是</label>
    <label>
      <input type="radio" name="RadioGroupHotel1" value="否" id="RadioGroupHotel1_1" onclick="javascript:show(this)"/>
      否</label>
     </p>

     <!--  
      <p><span>*</span> <label>是否用护照</label>
    <label>
      <input type="checkbox" name="RadioGroupOwn1" value="单选" id="RadioGroupOwn1_0" />
      是</label>
    <label>
      <input type="checkbox" name="RadioGroupOwn1" value="单选" id="RadioGroupOwn1_1" />
      否</label></p>
      
      <p><label class="lr"><span>*</span> 护照号码</label> &nbsp;&nbsp;<input value="${stu.passid}" name="passid" type="text" class="luru" /></p>
      <p><label class="lr"><span>*</span> 国籍</label>&nbsp;&nbsp;<input value="" name="country" type="text" class="luru" /></p>
      <p><label class="lr"><span>*</span> 签发日期</label> &nbsp;&nbsp;<input value="${stu.passSignTime}" name="passSignTime" class="Wdate" onClick="WdatePicker()" type="text" class="luru" /></p>
      <p><label class="lr"><span>*</span> 有效期至</label> &nbsp;&nbsp;<input value="${stu.passCloseTime}" name="passCloseTime" class="Wdate" onClick="WdatePicker()" type="text" class="luru" /></p>
      -->
<div class="order-bot1">
<span>参与项目信息</span>
<p class="order-bot1-li"><span>项目信息</span><span>项目时间</span><span style="padding-right:0">总计费用</span></p>
</div>  

<div class="wenben">
<span class="pig"><img src="${ctx}/static/images/pay-img01.jpg" /></span>
<span>${sp.name}</span><input  type="hidden" value="${sp.name}" name="projectname" />
<span style="padding-right:95px;">开始时间：<input style="" type="text" value="${sp.startTime}" name="startTime" readOnly="true"></span>
<span class="money">$<input type="text"  value="" id="totalprice" name="price" ></span>
<div style=" clear:both"></div>
<input  type="hidden" value="${sp.fpid}" name="fpid" />
<input  type="hidden" value="${sp.spid}" name="spid" />
<p class="butt"><img src="${ctx.resource}/images/order_btn.png"  onclick="checkform();"></p>
<div style=" clear:both"></div>
</div> 
</form> 
</div>
</div>
</div>
<div style=" clear:both"></div>
<div style="height:30px;"></div>

</div>
<script src="${ctx.resource}/js/vendor/jquery-1.11.0.min.js"></script>
 <script src="${ctx}/static/js/select2.min.js"></script>
 <script src="${ctx}/static/js/select2_locale_zh-CN.js"></script>
 <script src="${ctx.resource}/js/vendor/bootstrap.min.js"></script>
 <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
   <script type="text/javascript">

  $(document).ready(function() {
	  
    $.fn.select2School = function(options)
{
    var opts = $.extend($.fn.select2School.defaults, options);
    this.select2({
        allowClear:true,
        width: 300,
        placeholder: opts.blankMsg,
        minimumInputLength:opts.minLength,
        id:function(obj){return obj[opts.valueField]},
        ajax: {
            url: opts.url,
            dataType: 'json',
            quietMillis: opts.delay ,
            data: function (term, page) {return {name: term};},
            results: function (data, page) { return {results: data};}
        },
        formatResult: function(obj){return obj[opts.textField]},
        formatSelection:function(obj){return obj[opts.textField]},
        dropdownCssClass: "bigdrop",
        escapeMarkup: function (m) { return m; }
    });
}
	$.fn.select2School.defaults = {
    blankMsg: "请输入",
    minLength: 1,
    url:'',
    initUrl:'',
    delay:1000,
    valueField:'schoolname',
    textField:'schoolname'
	}
       $('input[name="schoolname"]').select2School({
            blankMsg:'搜索学校',//这里填写空选项时显示的文字
            url:'${ctx}/school/search-school-signature',//远程加载的url
            initUrl:'${ctx}/school/search-school-signature',//初始化url
            valueField:'schoolname',//value名   在vo中对应id的属性名
            textField: 'schoolname'//显示的text
        })
        
  })
</script>
</body>
</html>